package luogu;

import java.util.Scanner;

public class Main1271 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int [] count = new int[n+1];

        for (int i = 0; i <m ; i++) {
            int number = sc.nextInt();
            count[number]++;               //统计每个候选人对应的票数
        }

        StringBuilder sb = new StringBuilder();
        //遍历候选人
        for (int i = 1; i <=n ; i++) {
            //遍历候选人对应的票数
            for (int j = 0; j < count[i] ; j++) {
                sb.append(i).append(" ");
            }
        }
        System.out.println(sb.toString().trim());
    }
}
